﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace net.xBei.Helper
{
    public static class ProgramHelper
    {
        public static void FixMinThreads(int minCount = 1, bool force = false) {
            ThreadPool.GetMinThreads(out var minWorker, out var minIOC);
            if (force) {
                ThreadPool.SetMinThreads(minCount, minIOC);
            }else if (minWorker < minCount || minIOC < minCount) {
                ThreadPool.SetMinThreads(Math.Max(minCount, minWorker), Math.Max(minCount, minIOC));
            }
        }
    }
}
